 %iS=pinv(cov(X2(1:15:255,:)));
 
 x1=zeros(225,15);
 x2=zeros(225,15);
 
 l=[0,1;3,6;2,3;2,6;2,9;2,12;3,4;6,7;4,5;7,8;9,12;9,10;12,13;10,11;13,14];
 lr=l+ones(15,2);
 
 for i=1:225
     for j=1:15
     x1(i,j)=X1(i,lr(j,1)*15+lr(j,2)-1);
     x2(i,j)=X2(i,lr(j,1)*15+lr(j,2)-1);
     end
 end
 covx=cov(x2(1:225,:));
 covd=diag(covx);
 mu=mean(x2(1:225,:));
 
 for j=1:225
 v=x1(j,:) - mu;
 n=0;
 
 for i=1:15
      
     if(covd(i)~=0)
    n=(v(i)*v(i))+n;
     end
 end

 sqrt(n)
 end